\(\int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx\) [450]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 90 \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=-\frac {(2 a-3 b) \text {arctanh}(\sin (c+d x))}{2 b^2 d}+\frac {(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}+\frac {\sec (c+d x) \tan (c+d x)}{2 b d} \]

[Out]

-1/2*(2*a-3*b)*arctanh(sin(d*x+c))/b^2/d+(a-b)^(3/2)*arctanh(sin(d*x+c)*(a-b)^(1/2)/a^(1/2))/b^2/d/a^(1/2)+1/2
*sec(d*x+c)*tan(d*x+c)/b/d

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3757, 425, 536, 212, 214} \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}-\frac {(2 a-3 b) \text {arctanh}(\sin (c+d x))}{2 b^2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 b d} \]

[In]

Int[Sec[c + d*x]^5/(a + b*Tan[c + d*x]^2),x]

[Out]

-1/2*((2*a - 3*b)*ArcTanh[Sin[c + d*x]])/(b^2*d) + ((a - b)^(3/2)*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]])
/(Sqrt[a]*b^2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*b*d)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 425

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-b)*x*(a + b*x^n)^(p + 1)*
((c + d*x^n)^(q + 1)/(a*n*(p + 1)*(b*c - a*d))), x] + Dist[1/(a*n*(p + 1)*(b*c - a*d)), Int[(a + b*x^n)^(p + 1
)*(c + d*x^n)^q*Simp[b*c + n*(p + 1)*(b*c - a*d) + d*b*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c,
d, n, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  !( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomi
alQ[a, b, c, d, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3757

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{\left (1-x^2\right )^2 \left (a-(a-b) x^2\right )} \, dx,x,\sin (c+d x)\right )}{d} \\ & = \frac {\sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\text {Subst}\left (\int \frac {-a+2 b+(-a+b) x^2}{\left (1-x^2\right ) \left (a+(-a+b) x^2\right )} \, dx,x,\sin (c+d x)\right )}{2 b d} \\ & = \frac {\sec (c+d x) \tan (c+d x)}{2 b d}-\frac {(2 a-3 b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{2 b^2 d}+\frac {(a-b)^2 \text {Subst}\left (\int \frac {1}{a+(-a+b) x^2} \, dx,x,\sin (c+d x)\right )}{b^2 d} \\ & = -\frac {(2 a-3 b) \text {arctanh}(\sin (c+d x))}{2 b^2 d}+\frac {(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}+\frac {\sec (c+d x) \tan (c+d x)}{2 b d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(207\) vs. \(2(90)=180\).

Time = 1.47 (sec) , antiderivative size = 207, normalized size of antiderivative = 2.30 \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {2 (2 a-3 b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 (-2 a+3 b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-\frac {2 (a-b)^{3/2} \log \left (\sqrt {a}-\sqrt {a-b} \sin (c+d x)\right )}{\sqrt {a}}+\frac {2 (a-b)^{3/2} \log \left (\sqrt {a}+\sqrt {a-b} \sin (c+d x)\right )}{\sqrt {a}}+\frac {b}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {b}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}}{4 b^2 d} \]

[In]

Integrate[Sec[c + d*x]^5/(a + b*Tan[c + d*x]^2),x]

[Out]

(2*(2*a - 3*b)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 2*(-2*a + 3*b)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/
2]] - (2*(a - b)^(3/2)*Log[Sqrt[a] - Sqrt[a - b]*Sin[c + d*x]])/Sqrt[a] + (2*(a - b)^(3/2)*Log[Sqrt[a] + Sqrt[
a - b]*Sin[c + d*x]])/Sqrt[a] + b/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2 - b/(Cos[(c + d*x)/2] + Sin[(c + d*x
)/2])^2)/(4*b^2*d)

Maple [A] (verified)

Time = 6.52 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.43

method result size
derivativedivides \(\frac {-\frac {1}{4 b \left (\sin \left (d x +c \right )+1\right )}+\frac {\left (-2 a +3 b \right ) \ln \left (\sin \left (d x +c \right )+1\right )}{4 b^{2}}-\frac {1}{4 b \left (\sin \left (d x +c \right )-1\right )}+\frac {\left (2 a -3 b \right ) \ln \left (\sin \left (d x +c \right )-1\right )}{4 b^{2}}-\frac {\left (-a^{2}+2 a b -b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{b^{2} \sqrt {a \left (a -b \right )}}}{d}\) \(129\)
default \(\frac {-\frac {1}{4 b \left (\sin \left (d x +c \right )+1\right )}+\frac {\left (-2 a +3 b \right ) \ln \left (\sin \left (d x +c \right )+1\right )}{4 b^{2}}-\frac {1}{4 b \left (\sin \left (d x +c \right )-1\right )}+\frac {\left (2 a -3 b \right ) \ln \left (\sin \left (d x +c \right )-1\right )}{4 b^{2}}-\frac {\left (-a^{2}+2 a b -b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{b^{2} \sqrt {a \left (a -b \right )}}}{d}\) \(129\)
risch \(-\frac {i \left ({\mathrm e}^{3 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}\right )}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a}{d \,b^{2}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d b}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a}{d \,b^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d b}+\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {a \left (a -b \right )}\, {\mathrm e}^{i \left (d x +c \right )}}{a -b}-1\right )}{2 d \,b^{2}}-\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {a \left (a -b \right )}\, {\mathrm e}^{i \left (d x +c \right )}}{a -b}-1\right )}{2 a d b}-\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {a \left (a -b \right )}\, {\mathrm e}^{i \left (d x +c \right )}}{a -b}-1\right )}{2 d \,b^{2}}+\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {a \left (a -b \right )}\, {\mathrm e}^{i \left (d x +c \right )}}{a -b}-1\right )}{2 a d b}\) \(364\)

[In]

int(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/4/b/(sin(d*x+c)+1)+1/4/b^2*(-2*a+3*b)*ln(sin(d*x+c)+1)-1/4/b/(sin(d*x+c)-1)+1/4*(2*a-3*b)/b^2*ln(sin(d
*x+c)-1)-1/b^2*(-a^2+2*a*b-b^2)/(a*(a-b))^(1/2)*arctanh((a-b)*sin(d*x+c)/(a*(a-b))^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 292, normalized size of antiderivative = 3.24 \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\left [-\frac {2 \, {\left (a - b\right )} \sqrt {\frac {a - b}{a}} \cos \left (d x + c\right )^{2} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} + 2 \, a \sqrt {\frac {a - b}{a}} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) + {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, b \sin \left (d x + c\right )}{4 \, b^{2} d \cos \left (d x + c\right )^{2}}, -\frac {4 \, {\left (a - b\right )} \sqrt {-\frac {a - b}{a}} \arctan \left (\sqrt {-\frac {a - b}{a}} \sin \left (d x + c\right )\right ) \cos \left (d x + c\right )^{2} + {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, b \sin \left (d x + c\right )}{4 \, b^{2} d \cos \left (d x + c\right )^{2}}\right ] \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

[-1/4*(2*(a - b)*sqrt((a - b)/a)*cos(d*x + c)^2*log(-((a - b)*cos(d*x + c)^2 + 2*a*sqrt((a - b)/a)*sin(d*x + c
) - 2*a + b)/((a - b)*cos(d*x + c)^2 + b)) + (2*a - 3*b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (2*a - 3*b)*co
s(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*b*sin(d*x + c))/(b^2*d*cos(d*x + c)^2), -1/4*(4*(a - b)*sqrt(-(a - b)/
a)*arctan(sqrt(-(a - b)/a)*sin(d*x + c))*cos(d*x + c)^2 + (2*a - 3*b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (
2*a - 3*b)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*b*sin(d*x + c))/(b^2*d*cos(d*x + c)^2)]

Sympy [F]

\[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\int \frac {\sec ^{5}{\left (c + d x \right )}}{a + b \tan ^{2}{\left (c + d x \right )}}\, dx \]

[In]

integrate(sec(d*x+c)**5/(a+b*tan(d*x+c)**2),x)

[Out]

Integral(sec(c + d*x)**5/(a + b*tan(c + d*x)**2), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is

Giac [A] (verification not implemented)

none

Time = 0.50 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.46 \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=-\frac {\frac {{\left (2 \, a - 3 \, b\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{b^{2}} - \frac {{\left (2 \, a - 3 \, b\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{b^{2}} - \frac {4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{\sqrt {-a^{2} + a b} b^{2}} + \frac {2 \, \sin \left (d x + c\right )}{{\left (\sin \left (d x + c\right )^{2} - 1\right )} b}}{4 \, d} \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

-1/4*((2*a - 3*b)*log(abs(sin(d*x + c) + 1))/b^2 - (2*a - 3*b)*log(abs(sin(d*x + c) - 1))/b^2 - 4*(a^2 - 2*a*b
 + b^2)*arctan(-(a*sin(d*x + c) - b*sin(d*x + c))/sqrt(-a^2 + a*b))/(sqrt(-a^2 + a*b)*b^2) + 2*sin(d*x + c)/((
sin(d*x + c)^2 - 1)*b))/d

Mupad [B] (verification not implemented)

Time = 13.71 (sec) , antiderivative size = 268, normalized size of antiderivative = 2.98 \[ \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx=-\frac {\left (\frac {\mathrm {atanh}\left (\frac {\sin \left (c+d\,x\right )\,\sqrt {a-b}}{\sqrt {a}}\right )\,{\left (a-b\right )}^{3/2}\,1{}\mathrm {i}}{2}-a^{3/2}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-a^{3/2}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )+\frac {\cos \left (2\,c+2\,d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (c+d\,x\right )\,\sqrt {a-b}}{\sqrt {a}}\right )\,{\left (a-b\right )}^{3/2}\,1{}\mathrm {i}}{2}\right )\,1{}\mathrm {i}}{\sqrt {a}\,b^2\,d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {\left (\frac {\sqrt {a}\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{2}+\frac {3\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )}{2}\right )\,1{}\mathrm {i}}{\sqrt {a}\,b\,d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )} \]

[In]

int(1/(cos(c + d*x)^5*(a + b*tan(c + d*x)^2)),x)

[Out]

- (((atanh((sin(c + d*x)*(a - b)^(1/2))/a^(1/2))*(a - b)^(3/2)*1i)/2 - a^(3/2)*atan((sin(c/2 + (d*x)/2)*1i)/co
s(c/2 + (d*x)/2)) - a^(3/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x) + (cos(2*c + 2*d
*x)*atanh((sin(c + d*x)*(a - b)^(1/2))/a^(1/2))*(a - b)^(3/2)*1i)/2)*1i)/(a^(1/2)*b^2*d*(cos(2*c + 2*d*x)/2 +
1/2)) - (((a^(1/2)*sin(c + d*x)*1i)/2 + (3*a^(1/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2)))/2 + (3*a^
(1/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x))/2)*1i)/(a^(1/2)*b*d*(cos(2*c + 2*d*x)
/2 + 1/2))